<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>

<%
	String path = request.getContextPath();
 %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<head>
		<script type="text/javascript" language="javascript" src="<%=path%>/js/jquery-1.3.1.min.js"></script>
		<script type="text/javascript" language="javascript" src="<%=path%>/js/jquery.jmodal.js"></script>
		<link href="<%=path%>/css/main.css" type="text/css" rel="stylesheet"/>
		<link href="<%=path%>/css/jquery.jmodal.css" type="text/css" rel="stylesheet"/>
		<script language="JavaScript" src="self.js" type="text/JavaScript"charset="utf-8"></script>

		<title>修改页面</title>
	</head>

	<body>
        
		<f:view>
			<h:form id="selfUserForm" >
				<h:inputHidden id="password" value="#{peopleBean.password}"></h:inputHidden>
				<h:inputHidden id="userID" value="#{peopleBean.userId}"></h:inputHidden>
				<h:inputHidden id="isEdit" value="#{peopleBean.isEdit}"></h:inputHidden>

				<h:inputHidden id="roleCheckbox" value="#{peopleBean.roleCheckbox}"></h:inputHidden>
				<h:inputHidden id="roleChecked" value="#{peopleBean.roleChecked}"></h:inputHidden>
				<h:inputHidden id="roleId" value="#{peopleBean.roleId}"></h:inputHidden>
<div class="cont2">
  <div class="table2">
    <div class="title1Bg">
     <div class="title1 f14"><strong>个人用户信息修改</strong><span class="f12 fright"><h:commandButton action="#{peopleBean.updSelfInfo}"
										styleClass="but_submit" onclick="return submitSelfInfo();" value="提交">
														</h:commandButton>
	   <h:commandLink value="返回"  styleClass="buts but6" action="#{peopleBean.backToSearch}" />       
	 </span></div>
	</div>
    <div class="cont3Bg">
      <div class="cont3Bg2">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cont4">
        <tr><td colspan="2" class="td3" height="1"></td></tr>
          <tr>
            <td class="td1 f14"><span>*</span>用户ID:</td>
            <td> <h:inputText id="userId"  value="#{peopleBean.userId}"    styleClass="input2" disabled="true" required="false"> 
             </h:inputText>  <span class="red"> <h:message for="userId"></h:message>* </span></td>
          </tr>
        <tr><td colspan="2" class="td3" height="1"></td></tr>
          <tr>
            <td class="td1 f14"><span>*</span>用户姓名:</td>
            <td> <h:inputText id="userName"  value="#{peopleBean.userName}"    styleClass="input2"  required="false"> 
             </h:inputText>  <span class="red"> <h:message for="userName"></h:message>* </span></td>
          </tr>
          <tr><td colspan="2" class="td3" height="1"></td></tr>
          <tr>
            <td class="f14">电话:</td>
            <td> <h:inputText id="phone"   styleClass="input2" value="#{peopleBean.phone}" required="false"> 
                 </h:inputText> <span class="red"> <h:message for="phone"></h:message>* </span>&nbsp;
            </td>
          </tr>
          <tr><td colspan="2" class="td3" height="1"></td></tr>
          <tr>
            <td class="f14">手机:</td>
            <td> <h:inputText id="mobile"   styleClass="input2" value="#{peopleBean.mobile}" required="false"> 
                 </h:inputText> <span class="red"> <h:message for="mobile"></h:message>* </span>&nbsp;
            </td>
          </tr>
          <tr><td colspan="2" class="td3" height="1"></td></tr>
          <tr>
			<td  class="f14">用户角色:</td>
			<td >
					<span id="roleCheckBoxSpan"></span>
					<span class="red"> <h:message for="roleId"></h:message>* </span>&nbsp;
			</td>
		  </tr>
          <tr><td colspan="2" class="td3" height="1"></td></tr>
          <tr>
            <td class="f14">邮箱:</td>
            <td> <h:inputText id="email"   styleClass="input2" value="#{peopleBean.email}" required="false"> 
                 </h:inputText> <span class="red"> <h:message for="email"></h:message>* </span>&nbsp;
            </td>
          </tr>
          <tr><td colspan="2" class="td3" height="1"></td></tr>
          <tr>
            <td class="f14">备注:</td>
            <td> 
           <h:inputTextarea id="remark"  rows="3" cols="52"  value="#{peopleBean.remark}" required="false"> 
             </h:inputTextarea></td>
          </tr>
         
        </table>
      </div>
    </div>
  </div>
</div>
			</h:form>
		</f:view>
	</body>
</html>
<script language="Javascript" type="text/JavaScript" charset="utf-8">
var roleStr = "";
var roles = $("#selfUserForm\\:roleCheckbox").val();
if (roles.length > 0) {
	var role = eval("(" + roles + ")");
	for (var i in role) {
		roleStr += "<input type=\"checkbox\" id=\"" + role[i][0] + "\" " + role[i][2] + " disabled>" + role[i][1] + "</input> &nbsp;";
	}
}
$("#roleCheckBoxSpan").html(roleStr);
</script>